
needs = ['health', 'food', 'drink', 'luxury', 'shelter', 'trash', 'ball', 'couch', 'car', 'phone', 'game']

need_timeout = 20


#window_size = (640,480)
window_size = (800,600)
#window_size = (1024,768)
window_caption = "Taxtris"

dt = 1.0/50.0/10.0
#dt = 1.0/50.0

bgcolor = (0,0,0)
fgcolor = (255,255,255)
menubg = (156,32,32)
coincolor = (255,255,0)
brick_colors = [ (0,255,0), (255,255,0), (255,0,0) ]

step_size = 20
max_frame_time = 100

import os
import pygame

def to_pygame(p):
    global window_size
    return int(p.x), int(-p.y+window_size[1])

def flipy(y):
    global window_size
    return int(-y+window_size[1])

def load_image(name, colorkey=None):
    fullname = os.path.join('data', name)
    try:
        image = pygame.image.load(fullname)
    except pygame.error, message:
        print "Cannot load image:", name
        raise SystemExit, message

    image = image.convert_alpha()

    #image.set_colorkey((255,0,255))

    return image

def load_sound(name):
    class NoneSound:
        def play(self): pass

    if not pygame.mixer:
        print "mixer not loaded"
        return NoneSound()

    fullname = os.path.join('data', name)

    try:
        sound = pygame.mixer.Sound(fullname)
    except pygame.error, message:
        print 'Cannot load sound:', name
        raise SystemExit, message

    return sound
